<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>TodoList</title>
  <script src="../asset/js/vue.js"></script>
</head>

<body>
  <div id="app">
    <input type="text" v-model="inputValue">
    <button v-on:click='handleBtnClick'>提交</button>
    <ul>
      <li v-for='item of list'>{{item}}</li>
    </ul>
  </div>
  <script>
    let app = new Vue({
      el: '#app',
      data: {
        list: [],
        inputValue: ''
      },
      methods: {
        handleBtnClick() {
          let newList = this.inputValue;
          this.list.push(newList)
          this.inputValue = ''
        }
      }
    })
  </script>
</body>

</html>